/* 商品管理系统主样式文件 */

/* 导入响应式样式 */
@import url('responsive.css');

/* 全局样式 */
body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    background-color: #f8f9fa;
    line-height: 1.6;
}

a {
    color: #e44d26;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: #c73e1f;
    text-decoration: none;
}

.btn-primary {
    background-color: #e44d26;
    border-color: #e44d26;
}

.btn-primary:hover {
    background-color: #c73e1f;
    border-color: #c73e1f;
}

.btn-outline-primary {
    color: #e44d26;
    border-color: #e44d26;
}

.btn-outline-primary:hover {
    background-color: #e44d26;
    border-color: #e44d26;
}

/* 顶部导航栏 */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: bold;
    color: #e44d26 !important;
}

.navbar-nav .nav-link {
    font-weight: 500;
    margin: 0 10px;
}

.navbar-nav .nav-link:hover {
    color: #e44d26 !important;
}

/* 搜索框 */
.search-form {
    position: relative;
}

.search-form input {
    border-radius: 20px;
    padding-right: 40px;
}

.search-form button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: #666;
}

/* 购物车图标 */
.cart-icon {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #e44d26;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* 轮播图 */
.carousel-item {
    height: 400px;
    background-color: #f8f9fa;
}

.carousel-item img {
    height: 100%;
    object-fit: cover;
}

.carousel-caption {
    background-color: rgba(0,0,0,0.5);
    padding: 20px;
    border-radius: 10px;
}

/* 英雄区域 */
.hero {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 60px 0;
}

.hero-content {
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #666;
}

.btn-hero {
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 30px;
}

/* 分类区域 */
.category-card {
    border: none;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.category-image {
    height: 150px;
    overflow: hidden;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-card:hover .category-image img {
    transform: scale(1.05);
}

.category-title {
    font-weight: bold;
    margin: 0;
    padding: 15px;
    text-align: center;
}

/* 商品卡片 */
.product-card {
    border: none;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.product-image {
    height: 250px;
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #e44d26;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.product-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-actions {
    opacity: 1;
}

.product-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.product-action-btn:hover {
    background-color: #e44d26;
    color: white;
}

.product-body {
    padding: 15px;
}

.product-title {
    font-weight: bold;
    margin-bottom: 10px;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #e44d26;
    margin-bottom: 10px;
}

.product-rating {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.product-rating .stars {
    color: #ffc107;
    margin-right: 5px;
}

.product-rating .rating-count {
    color: #666;
    font-size: 0.9rem;
}

/* 分页 */
.pagination .page-link {
    color: #e44d26;
    border-color: #dee2e6;
}

.pagination .page-item.active .page-link {
    background-color: #e44d26;
    border-color: #e44d26;
}

.pagination .page-link:hover {
    color: #c73e1f;
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

/* 底部 */
.footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 50px 0 20px;
    margin-top: 50px;
}

.footer-links h5 {
    color: #e44d26;
    margin-bottom: 20px;
}

.footer-links ul {
    list-style: none;
    padding: 0;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links ul li a {
    color: #ecf0f1;
}

.footer-links ul li a:hover {
    color: #e44d26;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    color: #ecf0f1;
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.social-icons a:hover {
    color: #e44d26;
}

.footer-bottom {
    border-top: 1px solid #34495e;
    padding-top: 20px;
    margin-top: 30px;
    text-align: center;
}

/* 购物车 */
.cart-item {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.cart-item-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 15px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.cart-item-spec {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.cart-item-price {
    color: #e44d26;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-item-quantity input {
    width: 60px;
    text-align: center;
}

.cart-item-subtotal {
    font-weight: bold;
    color: #e44d26;
    font-size: 1.1rem;
    width: 100px;
    text-align: right;
}

.cart-item-remove {
    margin-left: 15px;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
}

.cart-item-remove:hover {
    color: #e44d26;
}

.cart-summary {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.cart-summary h5 {
    margin-bottom: 15px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.summary-row.total {
    font-weight: bold;
    font-size: 1.2rem;
    color: #e44d26;
    border-top: 1px solid #dee2e6;
    padding-top: 10px;
}

/* 个人中心 */
.profile-sidebar {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.profile-sidebar .nav-link {
    border-radius: 0;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.profile-sidebar .nav-link:hover {
    background-color: #f8f9fa;
    border-left-color: #e44d26;
}

.profile-sidebar .nav-link.active {
    background-color: #f8f9fa;
    border-left-color: #e44d26;
    color: #e44d26;
}

/* 订单 */
.order-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.order-header {
    background-color: #f8f9fa;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-number {
    font-weight: bold;
}

.order-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-paid {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status-shipped {
    background-color: #d4edda;
    color: #155724;
}

.status-delivered {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status-completed {
    background-color: #d4edda;
    color: #155724;
}

.status-cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

/* 地址 */
.address-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.address-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.address-card.default {
    border-color: #4CAF50;
    background-color: #f9fff9;
}

.default-badge {
    background-color: #4CAF50;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 10px;
}

/* 表单 */
.form-control:focus {
    border-color: #e44d26;
    box-shadow: 0 0 0 0.2rem rgba(228, 77, 38, 0.25);
}

.btn-check:focus + .btn, .btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(228, 77, 38, 0.25);
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-in-up {
    animation: slideInUp 0.5s ease-out;
}

/* 工具类 */
.text-primary {
    color: #e44d26 !important;
}

.bg-primary {
    background-color: #e44d26 !important;
}

.border-primary {
    border-color: #e44d26 !important;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,.1);
    border-radius: 50%;
    border-top-color: #e44d26;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast 通知 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
}

.toast {
    min-width: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.toast-error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.toast-warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.toast-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}